#include <iostream>
#include <cstdio>

int students[201];
int books[201];

int main(int argc, char const *argv[]){
    int n, m;
    while(scanf("%d%d", &n, &m) != EOF){
        for (int i = 1; i <= 200; i++){
            students[i] = 0;
            books[i] = 0;
        }
        for (int student_th = 1; student_th <= n; student_th++){
            scanf("%d", &students[student_th]);
            books[students[student_th]]++;
        }
        for (int student_th = 1; student_th <= n; student_th++){  
            if (books[students[student_th]] == 1)  
                printf("BeiJu\n");  
            else  
                printf("%d\n", books[students[student_th]]-1);  
        }  
    }
    return 0;
}
